package com.example.xunai.dto.response.user;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class UserResponse {
    private Long id;
    private String username;
    private String email;
    private String phone;
    private String nickname;
    private String avatar;
    private LocalDateTime createTime;
    private LocalDateTime updateTime;
    private Boolean isActive;

    public static UserResponse of(Long id, String username, String email, String phone,
                                  String nickname, String avatar, LocalDateTime createTime,
                                  LocalDateTime updateTime, Boolean isActive) {
        return UserResponse.builder()
                .id(id)
                .username(username)
                .email(email)
                .phone(phone)
                .nickname(nickname)
                .avatar(avatar)
                .createTime(createTime)
                .updateTime(updateTime)
                .isActive(isActive)
                .build();
    }
}